package com.example.cardemo.bean

import android.os.Parcel
import android.os.Parcelable

data class BrandlistBean(
    val reason: String?,
    val result: List<ResultBean>?,
    val error_code: Int?
) {
    data class ResultBean(
        val id: String,
        val name: String,
        val levelname: String,
        val sname: String
    ) : Parcelable {
        constructor(parcel: Parcel) : this(
            parcel.readString() ?: "",
            parcel.readString() ?: "",
            parcel.readString() ?: "",
            parcel.readString() ?: ""
        )

        override fun writeToParcel(parcel: Parcel, flags: Int) {
            parcel.writeString(id)
            parcel.writeString(name)
            parcel.writeString(levelname)
            parcel.writeString(sname)
        }

        override fun describeContents(): Int {
            return 0
        }

        companion object CREATOR : Parcelable.Creator<ResultBean> {
            override fun createFromParcel(parcel: Parcel): ResultBean {
                return ResultBean(parcel)
            }

            override fun newArray(size: Int): Array<ResultBean?> {
                return arrayOfNulls(size)
            }
        }
    }
}